<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta charset="utf-8"/>
<title>Giày dép</title>
<link rel="stylesheet" href="Css/cc.css"></link>
</head>
<body>
<div class="wrapper">
<?php include 'menu.php';?>
<div class="content">
		<div class="bigleft">
       	  <div class="bmmenu">
            	<div class="bmenu">
                    <ul>
                                <?php include 'connect.php';
                                    $menu = $con->query("Select * from category2");
                                    while ($row = mysqli_fetch_array($menu)) {
                                ?>
                            <li>
                                <div><a href="?dm=<?php echo $row['id'];?>"><?php echo $row["name"] ?></a></div>
                            </li>
                                    <?php } ?>
                    </ul>
                </div>
            </div>
<div class="bcontent">
     <?php
            $limit = 8;
            if(isset($_POST["btntim"]))
            {
                $search =$con->real_escape_string($_POST["txts"]);
                $result = $con->query("select count(*) from footwear where name LIKE '%{$search}%' ");}
            elseif (isset($_GET['dm']))
                {
                    $dm=$_GET['dm'];
                    $result =$con->query("SELECT count(*) from footwear where category_foot = ".$dm);
                }
            else
            {
                $result = $con->query("select count(*) from footwear");
            }
            $row3 = mysqli_fetch_array($result);
            $tongsp = $row3[0];
            $pages = ceil($tongsp / $limit);
        ?>
        <?php
            include 'footwear_list.php';
        ?>
</div>
     <br />
</div>
    <?php include 'menu_right.php'; ?>
    <div class="pages">
         <?php
         if (isset($_GET['dm']))
         {
             for($i=1;$i <= $pages; $i++)
            {
                echo "<a href=\"?dm={$dm}&&page={$i}\">{$i}</a> "." ";
            }
            
         }
         else{
            for($i=1;$i <= $pages; $i++)
            {
                echo "<a href=\"?page={$i}\">{$i}</a> "." ";
         }}
         ?>
    </div>
<div class="footer">
We are... Mr.Chuot Tru, Mr.Minh Ho
<hr  width="20%" style="margin-left:40%; margin-top:8px;"/>
<pre><br /><br />
Coppyright: Aitieducation
</pre>
</div>
</div>
</div>
</body>
</html>